package com.itboye.jinpuyiyuan.activity.login;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.itboye.jinpuyiyuan.MainActivity;
import com.itboye.jinpuyiyuan.R;
import com.itboye.jinpuyiyuan.activity.home.register.RegisterActivity;
import com.itboye.jinpuyiyuan.app.MyApplication;
import com.itboye.jinpuyiyuan.base.BaseActivity;

/**
 * Created by Administrator on 2017/12/7 0007.
 */

public class LoginOrRegisterActivity extends BaseActivity {
    private TextView tvLogin;
    private EditText etPhone,etConfirmPassword,etPassword,etVertifyCode;

    private TextView loginTv,lookAroundTv;
    private Button registerBt;
    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.activity_loginorregist);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        }

    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        switch (view.getId()){
            case R.id.loginTv:
            startActivity(new Intent(this,LoginActivity.class));
                break;
            case R.id.registerBt:
            startActivity(new Intent(this, RegistActivity.class));

                break;
            case R.id.lookAroundTv:
                startActivity(new Intent(this, MainActivity.class));

                break;


        }
    }
//    //记录用户首次点击返回键的时间
//    private long firstTime=0;
//
//    @Override
//    public boolean onKeyUp(int keyCode, KeyEvent event) {
//        switch (keyCode){
//            case KeyEvent.KEYCODE_BACK:
//                long secondTime=System.currentTimeMillis();
//                if(secondTime-firstTime>2000){
//                    Toast.makeText(LoginOrRegisterActivity.this,"再按一次退出程序",Toast.LENGTH_SHORT).show();
//                    firstTime=secondTime;
//                    return true;
//                }else{
//                    MyApplication.instatnce.removeAllActivity();
//                    System.exit(0);
//                }
//                break;
//        }
//        return super.onKeyUp(keyCode, event);
//    }


}
